/**  
 * @project_name yjd_back
 * @Title: CashoutStatus.java
 * @Package com.yjd.back.enums
 * @Description: TODO
 * @author lindy lindytem@126.com  
 * @date 2014-9-2 上午9:19:32
 * @version V1.0  
 * <b>Copyright (c)</b> 2014医信金融信息服务（上海）有限公司-版权所有<br/>
 */
package com.yjd.comm.enums;


/**
 * @ClassName: CashoutStatus
 * @Description: TODO
 * @author lindy lindytem@126.com
 * @date 2014-9-2 上午9:19:32
 */
public enum AcctRecordType {

	t_1(1,"在线充值",FundsDataPTypeEnum.CZ),
	t_2(2,"线下充值",FundsDataPTypeEnum.CZ),
	t_3(3,"活动奖励",FundsDataPTypeEnum.HDJL),
	t_7(7,"邀请奖励",FundsDataPTypeEnum.HDJL),
	t_5(5,"投资收益",1,FundsDataPTypeEnum.LC),
	t_6(6,"借款放款",1,FundsDataPTypeEnum.JK),
	t_v1(-1,"提现支出",FundsDataPTypeEnum.TX),
	t_v2(-2,"投资支出",-1,FundsDataPTypeEnum.LC),
	t_v3(-3,"借款服务费",-1,FundsDataPTypeEnum.JK),
	t_v4(-4,"借款账户管理费",-1,FundsDataPTypeEnum.JK),
	t_v5(-5,"还款",-1,FundsDataPTypeEnum.JK),
	t_v6(-6,"身份验证手续费",FundsDataPTypeEnum.QT),
	t_v7(-7,"借款担保费",-1,FundsDataPTypeEnum.JK),
	t_v8(-8,"借款实地审核费用",-1,FundsDataPTypeEnum.JK),
	t_v9(-9,"借款委托待查费用",-1,FundsDataPTypeEnum.JK),
	t_103(103,"提现解冻",FundsDataPTypeEnum.TX),
	t_102(102,"提现冻结",FundsDataPTypeEnum.TX),
	t_101(101,"投资流标解冻",FundsDataPTypeEnum.LC),
	t_100(100,"投资冻结",0,FundsDataPTypeEnum.LC),
	t_4(4,"充值券充值",FundsDataPTypeEnum.CZ),
	t_8(8,"理财金充值",FundsDataPTypeEnum.CZ),
	t_9(9,"理财金返现",1,FundsDataPTypeEnum.HDJL),
	t_10(10,"现金红包",1,FundsDataPTypeEnum.HDJL),
	t_11(11,"债权转让",1,FundsDataPTypeEnum.LC),
	t_v11(-11,"购买债权",-1,FundsDataPTypeEnum.LC),
	t_v12(-12,"债权转让管理费",FundsDataPTypeEnum.LC),
	t_12(12,"推广奖励",FundsDataPTypeEnum.HDJL),
	t_s200(-911, "代发工资",FundsDataPTypeEnum.QT),//弃用
	t_13(13, "工资转入",FundsDataPTypeEnum.QT),
	t_v13(-13,"提现手续费",FundsDataPTypeEnum.TX),
	t_14(14,"刮刮卡红包",1,FundsDataPTypeEnum.HDJL),
	t_15(15,"领取体验金",0,FundsDataPTypeEnum.HDJL),
	t_16(16,"体验金投标",0,FundsDataPTypeEnum.LC),
	t_17(17,"体验金收益",1,FundsDataPTypeEnum.LC),
	t_18(18,"活动返现",1,FundsDataPTypeEnum.HDJL),
	t_19(19,"首次投资返现",1,FundsDataPTypeEnum.HDJL),
	t_20(20,"医界贷账户转入小钱包",1,FundsDataPTypeEnum.LC),
	t_xqb_1(201,"小钱包转出到医界贷账户",1,FundsDataPTypeEnum.LC),
	t_xqb_rate(202,"小钱包收益",1,FundsDataPTypeEnum.LC),
	t_xqb_retake(203,"小钱包回购债权",-1, FundsDataPTypeEnum.LC),
	t_xqb_matchs(204,"小钱包匹配债权", 1 , FundsDataPTypeEnum.LC),
	t_xqb_Experience(205,"小钱包体验金",1, FundsDataPTypeEnum.LC),
	t_xqb_ExperienceProfit(206,"小钱包体验金收益",1, FundsDataPTypeEnum.LC),
	t_gold_matchs(207,"医信宝匹配债权",1, FundsDataPTypeEnum.LC),
	t_gold_recycle(208,"医信宝中间账户回购债权",-1, FundsDataPTypeEnum.LC),
	t_gold_creditor_maturity(209, "债权到期中间账户减钱", -1, FundsDataPTypeEnum.LC);
	private AcctRecordType(int code, String label,FundsDataPTypeEnum ptype) {
		this.code = code;
		this.label = label;
		this.setPType(ptype);
	}
	private AcctRecordType(int code, String label,int income) {
		this.code = code;
		this.label = label;
		this.income = income;
	}
	private AcctRecordType(int code, String label,int income,FundsDataPTypeEnum ptype) {
		this.code = code;
		this.label = label;
		this.income = income;
		this.setPType(ptype);
	}

	private void setPType(FundsDataPTypeEnum ptype){
		if(ptype!=null){
			this.p_type = ptype.getValue();
		}
	}

	private int code;

	private String label;
	
	private int income;
	
	private int p_type;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
	public int getIncome() {
		return income;
	}
	public void setIncome(int income) {
		this.income = income;
	}
	public int getP_type() {
		return p_type;
	}
	public void setP_type(int p_type) {
		this.p_type = p_type;
	}
	
	public static void main(String[] args) {
		for(AcctRecordType t:AcctRecordType.values()){
			System.out.println(String.format("update `yjd_funds_data` set `p_type` = %s where `type` = %s;", t.getP_type(),t.getCode()));
		}
	}

}
